package topcoder;

public class TheDeviceDiv2 {

	public String identify(String[] plates) {
		
		int m = plates[0].length();
		int n = plates.length;
		
		for(int i = 0; i < m; i++) {
			
			int c0 = 0, c1 = 0;
			boolean valid = false;
			
			for(int j = 0; j < n; j++){
				
				if( plates[j].charAt(i) == '0' )
					c0 += 1;
				else
					c1 += 1;
				
				if ( c0 >= 1 && c1 >= 2) {
					valid = true;
					break;
				}
			}
			
			if (!valid)
				return "NO";			
		}
		
		return "YES";
		
	}
}
